function login(){
    let password = document.getElementById("password").value
    let id = document.getElementById("id").value
    document.cookie = "id="+id
    document.cookie = "password="+password
    // console.log(document.cookie)
    $.ajax({
        type: "post",
        url:"http://81.68.240.146:5256/book/",
        dataType: "json",
        //携带cookie
        xhrFields: {
          withCredentials: true
        },
        crossDomain: true,
        data:JSON.stringify({          
            's_pwd':password,
            's_id':id
        }),
        success:function(data){
            console.log('okkk')
        },
        error:function(e){
            console.log('noooo')
        }
      })
    // $.ajax({
    //     url: 'http://81.68.240.146:5256/book/',
    //     type: 'POST',
    //     data: JSON.stringify({          
    //         's_pwd':password,
    //         's_id':id
    //     }),
    //     contentType:"application/JSON;charset=UTF-8",
    //     dataType:'json',
    //     Headers:{
    //         withCredential:true
    //     },
    //     success: function(data) { // 接口调用成功回调函数
    //         // data 为服务器返回的数据
    //         console.log(data)
    //         // if(status)
    //         // location.href = "../index.html"
    //     },
    //     Error:function(data){
    //         alert('no')
    //     }
    // });
}
function register(){
    location.href = "./register.html"
}

// 接口